home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / russell / gc32.lha / Makefile < prev    next >
Makefile  |  1993-07-22  |  4KB  |  87 lines

  1. # Redefining srcdir allows object code for the nonPCR version of the collector
  2. # to be generated in different directories
  3. srcdir = .
  4. VPATH = $(srcdir)
  5.  
  6. OBJS= alloc.o reclaim.o allochblk.o misc.o mach_dep.o os_dep.o mark_roots.o headers.o mark.o obj_map.o black_list.o finalize.o new_hblk.o real_malloc.o dynamic_load.o debug_malloc.o malloc.o stubborn.o checksums.o
  7.  
  8. CSRCS= reclaim.c allochblk.c misc.c alloc.c mach_dep.c os_dep.c mark_roots.c headers.c mark.c obj_map.c pcr_interface.c black_list.c finalize.c new_hblk.c real_malloc.c dynamic_load.c debug_malloc.c malloc.c stubborn.c checksums.c
  9.  
  10. SRCS= $(CSRCS) mips_mach_dep.s rs6000_mach_dep.s alpha_mach_dep.s gc.h gc_headers.h gc_private.h config.h gc_inline.h gc.man if_mach.c if_not_there.c
  11.  
  12. # The following is irrelevant on most systems.  But a few
  13. # versions of make otherwise fork the shell specified in
  14. # the SHELL environment variable.
  15. SHELL= /bin/sh
  16.  
  17. CC= cc
  18. CFLAGS= -O -DSILENT
  19. # Setjmp_test may yield overly optimistic results when compiled
  20. # without optimization.
  21. # -DSILENT disables statistics printing, and improves performance.
  22. # -DCHECKSUMS reports on erroneously clear dirty bits, and unexpectedly
  23. # altered stubborn objects, at substantial performance cost.
  24. # -DFIND_LEAK causes the collector to assume that all inaccessible
  25. # objects should have been explicitly deallocated, and reports exceptions
  26.  
  27. SPECIALCFLAGS = 
  28. # Alternative flags to the C compiler for mach_dep.c.
  29. # Mach_dep.c often doesn't like optimization, and it's
  30. # not time-critical anyway.
  31. # Set SPECIALCFLAGS to -q nodirect_code on Encore.
  32.  
  33. all: gc.a gctest
  34.  
  35. pcr: PCR-Makefile gc_private.h gc_headers.h gc.h config.h mach_dep.o $(SRCS)
  36.     make -f PCR-Makefile depend
  37.     make -f PCR-Makefile
  38.  
  39. $(OBJS) test.o: $(srcdir)/gc_private.h $(srcdir)/gc_headers.h $(srcdir)/gc.h $(srcdir)/config.h
  40.  
  41. gc.a: $(OBJS)
  42.     ar ru gc.a $(OBJS)
  43.     ranlib gc.a || cat /dev/null
  44. #    ignore ranlib failure; that usually means it doesn't exist, and isn't needed
  45.  
  46. mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/mips_mach_dep.s $(srcdir)/rs6000_mach_dep.s if_mach if_not_there
  47.     rm -f mach_dep.o
  48.     ./if_mach MIPS "" as -o mach_dep.o $(srcdir)/mips_mach_dep.s
  49.     ./if_mach RS6000 "" as -o mach_dep.o $(srcdir)/rs6000_mach_dep.s
  50.     ./if_mach ALPHA "" as -o mach_dep.o $(srcdir)/alpha_mach_dep.s
  51.     ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
  52.  
  53. if_mach: $(srcdir)/if_mach.c $(srcdir)/config.h
  54.     $(CC) $(CFLAGS) -o if_mach $(srcdir)/if_mach.c
  55.  
  56. if_not_there: $(srcdir)/if_not_there.c
  57.     $(CC) $(CFLAGS) -o if_not_there $(srcdir)/if_not_there.c
  58.  
  59. clean: 
  60.     rm -f gc.a test.o gctest output-local output-diff $(OBJS) \
  61.           setjmp_test  mon.out gmon.out a.out core if_not_there if_mach
  62.     -rm -f *~
  63.  
  64. gctest: test.o gc.a if_mach if_not_there
  65.     rm -f gctest
  66.     ./if_mach ALPHA "" $(CC) $(CFLAGS) -o gctest -non_shared test.o gc.a
  67.     ./if_not_there gctest $(CC) $(CFLAGS) -o gctest test.o gc.a
  68.  
  69. # If an optimized setjmp_test generates a segmentation fault,
  70. # odds are your compiler is broken.  Gctest may still work.
  71. # Try compiling setjmp_test unoptimized.
  72. setjmp_test: $(srcdir)/setjmp_test.c $(srcdir)/gc.h if_mach if_not_there
  73.     rm -f setjmp_test
  74.     ./if_mach ALPHA "" $(CC) $(CFLAGS) -o setjmp_test -non_shared $(srcdir)/setjmp_test.c
  75.     ./if_not_there setjmp_test $(CC) $(CFLAGS) -o setjmp_test $(srcdir)/setjmp_test.c
  76.  
  77. test: setjmp_test gctest
  78.     ./setjmp_test
  79.     ./gctest
  80.  
  81. tar:
  82.     tar cvf gc.tar $(SRCS) Makefile PCR-Makefile OS2_MAKEFILE README test.c setjmp_test.c
  83.     compress gc.tar
  84.  
  85. lint: $(CSRCS) test.c
  86.     lint -DLINT $(CSRCS) test.c | egrep -v "possible pointer alignment problem|abort|exit|sbrk|mprotect|syscall"
  87.